home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / man / lib.fmt / c / ftruncate.man < prev    next >
Encoding:
Text File  |  1991-09-19  |  3.4 KB  |  133 lines

  1.  
  2.  
  3.  
  4. TRUNCATE              C Library Procedures               TRUNCATE
  5.  
  6.  
  7.  
  8. NNAAMMEE
  9.      truncate, ftruncate - set a file to a specified length
  10.  
  11. SSYYNNOOPPSSIISS
  12.      ##iinncclluuddee <<ssyyss//ttyyppeess..hh>>
  13.  
  14.      iinntt ttrruunnccaattee((ppaatthh,, lleennggtthh))
  15.      cchhaarr **ppaatthh;;
  16.      ooffff__tt lleennggtthh;;
  17.  
  18.      iinntt ffttrruunnccaattee((ffdd,, lleennggtthh))
  19.      iinntt ffdd;;
  20.      ooffff__tt lleennggtthh;;
  21.  
  22. DDEESSCCRRIIPPTTIIOONN
  23.      ttrruunnccaattee(()) causes the file referred to by _p_a_t_h (or for
  24.      ffttrruunnccaattee(()) the object referred to by _f_d) to have a size
  25.      equal to _l_e_n_g_t_h bytes.  If the file was previously longer
  26.      than _l_e_n_g_t_h, the extra bytes are removed from the file.  If
  27.      it was shorter, bytes between the old and new lengths are
  28.      read as zeroes.  With ffttrruunnccaattee(()), the file must be open for
  29.      writing.
  30.  
  31. RREETTUURRNN VVAALLUUEESS
  32.      ttrruunnccaattee(()) returns:
  33.  
  34.      0    on success.
  35.  
  36.      -1   on failure and sets eerrrrnnoo to indicate the error.
  37.  
  38. EERRRROORRSS
  39.      ttrruunnccaattee(()) may set eerrrrnnoo to:
  40.  
  41.      EACCES              Search permission is denied for a com-
  42.                          ponent of the path prefix of _p_a_t_h.
  43.  
  44.                          Write permission is denied for the file
  45.                          referred to by _p_a_t_h.
  46.  
  47.      EFAULT              _p_a_t_h points outside the process's allo-
  48.                          cated address space.
  49.  
  50.      EIO                 An I/O error occurred while reading from
  51.                          or writing to the file system.
  52.  
  53.      EISDIR              The file referred to by _p_a_t_h is a direc-
  54.                          tory.
  55.  
  56.      ELOOP               Too many symbolic links were encountered
  57.                          in translating _p_a_t_h.
  58.  
  59.      ENAMETOOLONG        The length of the path argument exceeds
  60.  
  61.  
  62.  
  63. Sprite v1.0              21 January 1990                        1
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TRUNCATE              C Library Procedures               TRUNCATE
  71.  
  72.  
  73.  
  74.                          {PATH_MAX}.
  75.  
  76.                          A pathname component is longer than
  77.                          {NAME_MAX} (see ssyyssccoonnff(2V)) while
  78.                          {_POSIX_NO_TRUNC} is in effect (see
  79.                          ppaatthhccoonnff(2V)).
  80.  
  81.      ENOENT              The file referred to by _p_a_t_h does not
  82.                          exist.
  83.  
  84.      ENOTDIR             A component of the path prefix of _p_a_t_h
  85.                          is not a directory.
  86.  
  87.      EROFS               The file referred to by _p_a_t_h resides on
  88.                          a read-only file system.
  89.  
  90.      ffttrruunnccaattee(()) may set eerrrrnnoo to:
  91.  
  92.      EINVAL              _f_d is not a valid descriptor of a file
  93.                          open for writing.
  94.  
  95.                          _f_d refers to a socket, not to a file.
  96.  
  97.      EIO                 An I/O error occurred while reading from
  98.                          or writing to the file system.
  99.  
  100. SSEEEE AALLSSOO
  101.      ooppeenn(2V)
  102.  
  103. BBUUGGSS
  104.      These calls should be generalized to allow ranges of bytes
  105.      in a file to be discarded.
  106.  
  107.  
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129. Sprite v1.0              21 January 1990                        2
  130.  
  131.  
  132.  
  133.